package com.maserb.monitor.repository;

import com.maserb.monitor.entity.JwVideoEntity;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface JwVideoRepository  extends JpaSpecificationExecutor<JwVideoEntity>
        , PagingAndSortingRepository<JwVideoEntity, String> {
    List<JwVideoEntity> findByTitle(String title);

    @Query(value = "select max(favorites) from JwVideoEntity ")
    Integer find();
}